<?php

require __DIR__ . '/../vendor/autoload.php';

$app = require_once __DIR__ . '/../bootstrap/app.php';

$app->make(\App\Console\Kernel::class)->bootstrap();

/* ============== Write Codes Below ================= */

echo '>>> Start Laravel from CLI' . PHP_EOL;

/** @var \App\Services\WalletService $walletService */
$walletService = app()->get(\App\Services\WalletService::class);

$tokenIds = [
    '7559179796682001115711119808379466806407961301883587725567534846',
    '5359730062568304375017078215925459211606328388273950333392932607',
];

$contractAddress = '0xb53964bbb366c496082de72e5fe5b07d3d2a382e';

foreach ($tokenIds as $tokenId) {
    $result = $walletService->tokenTransList(
        $contractAddress,
        $tokenId,
    );
    $walletService->transfer($result[0]['hodler'], $contractAddress, $tokenId, $result[0]['originalHolder']);
    $result1 = $walletService->tokenTransList(
        $contractAddress,
        $tokenId,
    );
    dump($result1[0]['holder']);
}
